curl --request POST \
--url https://rai-prod.studio.lyzr.ai/v1/rai/policies \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"name": "<string>",
"description": "<string>",
"allowed_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"banned_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"keywords": {
"enabled": true,
"keywords": [
"<string>"
]
},
"toxicity_check": {
"enabled": true,
"threshold": 123
},
"prompt_injection": {
"enabled": true,
"threshold": 123
},
"secrets_detection": {
"enabled": true,
"action": "<string>"
},
"pii_detection": {
"enabled": true,
"types": {},
"custom_pii": [
{
"label": "<string>",
"replacement": "<string>",
"action": "<string>"
}
]
},
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}'
{
"_id": "<string>",
"name": "<string>",
"description": "<string>",
"allowed_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"banned_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"keywords": {
"enabled": true,
"keywords": [
"<string>"
]
},
"toxicity_check": {
"enabled": true,
"threshold": 123
},
"prompt_injection": {
"enabled": true,
"threshold": 123
},
"secrets_detection": {
"enabled": true,
"action": "<string>"
},
"pii_detection": {
"enabled": true,
"types": {},
"custom_pii": [
{
"label": "<string>",
"replacement": "<string>",
"action": "<string>"
}
]
},
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
curl --request POST \
--url https://rai-prod.studio.lyzr.ai/v1/rai/policies \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"name": "<string>",
"description": "<string>",
"allowed_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"banned_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"keywords": {
"enabled": true,
"keywords": [
"<string>"
]
},
"toxicity_check": {
"enabled": true,
"threshold": 123
},
"prompt_injection": {
"enabled": true,
"threshold": 123
},
"secrets_detection": {
"enabled": true,
"action": "<string>"
},
"pii_detection": {
"enabled": true,
"types": {},
"custom_pii": [
{
"label": "<string>",
"replacement": "<string>",
"action": "<string>"
}
]
},
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}'
{
"_id": "<string>",
"name": "<string>",
"description": "<string>",
"allowed_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"banned_topics": {
"enabled": true,
"topics": [
"<string>"
]
},
"keywords": {
"enabled": true,
"keywords": [
"<string>"
]
},
"toxicity_check": {
"enabled": true,
"threshold": 123
},
"prompt_injection": {
"enabled": true,
"threshold": 123
},
"secrets_detection": {
"enabled": true,
"action": "<string>"
},
"pii_detection": {
"enabled": true,
"types": {},
"custom_pii": [
{
"label": "<string>",
"replacement": "<string>",
"action": "<string>"
}
]
},
"user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
/v1/rai/policies
x-api-key
: API key for authentication (required)Content-Type
: application/json
{
"name": "string",
"description": "string",
"allowed_topics": {
"enabled": false,
"topics": []
},
"banned_topics": {
"enabled": false,
"topics": []
},
"keywords": {
"enabled": false,
"keywords": []
},
"toxicity_check": {
"enabled": true,
"threshold": 1
},
"prompt_injection": {
"enabled": true,
"threshold": 1
},
"secrets_detection": {
"enabled": true,
"action": "mask"
},
"pii_detection": {
"enabled": true,
"types": {},
"custom_pii": [
{
"label": "string",
"replacement": "string",
"action": "redact"
}
]
},
"user_id": "string",
"created_at": "2025-05-16T10:55:33.101Z",
"updated_at": "2025-05-16T10:55:33.101Z"
}
{
"_id": "string",
"name": "string",
"description": "string",
"allowed_topics": {
"enabled": false,
"topics": []
},
"banned_topics": {
"enabled": false,
"topics": []
},
"keywords": {
"enabled": false,
"keywords": []
},
"toxicity_check": {
"enabled": true,
"threshold": 1
},
"prompt_injection": {
"enabled": true,
"threshold": 1
},
"secrets_detection": {
"enabled": true,
"action": "mask"
},
"pii_detection": {
"enabled": true,
"types": {},
"custom_pii": [
{
"label": "string",
"replacement": "string",
"action": "redact"
}
]
},
"user_id": "string",
"created_at": "2025-05-16T10:55:33.116Z",
"updated_at": "2025-05-16T10:55:33.116Z"
}
{
"detail": [
{
"loc": ["string", 0],
"msg": "string",
"type": "string"
}
]
}
curl -X 'POST' 'https://rai-prod.studio.lyzr.ai/v1/rai/policies' -H 'accept: application/json' -H 'x-api-key: sk-default-Bk19s6ZUGIBoBkJNdkJ8YfcPLwULRXcH' -H 'Content-Type: application/json' -d '{...}'
Successful Response
The response is of type object
.